{% extends "generalTemplate.html" %}
{% block pageName %}User Profile.{% endblock %}

{% block queryScript %}

<script type="text/javascript" src="/bvapp/static/js/ui.core.js"></script>
<script type="text/javascript" src="/bvapp/static/js/ui.tabs.js"></script>


<script type="text/javascript" src="/bvuserapp/static/js/user_read.js"></script>
<script type="text/javascript" src="/bvuserapp/static/js/user_write.js"></script>
	

<script type="text/javascript">

  function load_info() {
  }
</script>

<script type="text/javascript">
  $(document).ready(function(){
    $("#tabbed-container > ul").tabs()
  });
</script>

{% endblock %}
{% block container %}

<div id="col2">		
{% if user.is_authenticated %}
	<div id="tabbed-container">
    <ul>
        <li><a href="#Overview"><span>Overview</span></a></li>
        <li><a href="#Edit"><span>Edit</span></a></li>            
    </ul>
    
    <div id="Overview">
		<a href="/showimage" target="_blank"><img src="/showimage" width="250" height="250"></a>
		<br></br><br></br>
		<h3>Basic information</h3><br></br>
		<div id="name_div">User Name: {{ user.username }}</div>
		<div id="name_div">First Name: {{ user.first_name }}</div>
		<div id="name_div">Last Name: {{ user.last_name }}</div>
		<div id="Email">Email: {{ user.email }}</div>
    	<br></br><br></br>
		<h3>More information</h3><br></br>
		<div id="name_div">Personal Statement: {{ user.personal_statement }}</div>
		<div id="name_div">Score: {{ user.score }}</div>
		<div id="name_div">Homepage: {{ user.home_page }}</div>
		<div id="Email">Mt Edits: {{ user.mt_edits }}</div>
		<br></br><br></br>
		<form action="/simple_upload/" enctype="multipart/form-data" method="post">
		<div><input name="img" type="file"></div>
		<div><input value="upload image" type="submit"></div>
		</form>
		
    </div>
 <div id="Edit">
 [Edit part goes here]
 <form action="/edit_user/" method="post">
 
		<h3>Edit Basic information</h3><br></br>
		<div id="name_div">First Name: <input type="text" value="{{ user.first_name }}" name="first_name" id="first_name" /></div>
		
		<div id="name_div">Last Name: <input type="text" value="{{ user.last_name }}" name="last_name" id="last_name" /></div>
    	<br></br><br></br>
		<h3>Edit More information</h3><br></br>
		<div id="name_div">Personal Statement: <input type="text" value="{{ user.personal_statement }}" name="personal_statement" id="personal_statement" /></div>
		
		<div id="name_div">Homepage: <input type="text" value="{{ user.home_page }}" name="home_page" id="home_page" /></div>
		
		<br/><br/>
 <div><input value="edit" type="submit"></div>
 </form>
 </div>
    
</div>
	
{% else %}
    <p> You must <a href="{% url django.contrib.auth.views.login %}">login</a>  
    or <a href="{% url registration.views.register %}">register</a>, to view this page.  
    Once you are logged in, click on your user name to return here.  
{% endif %}
	
</div>

{% endblock %}
